<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>模板字符串</title>
</head>

<body>
    <div class="box"></div>
    <script type="text/javascript">
        //模板字符串的特性ES6
        var dataInfo = {
            name: "cc",
            age: 18,
            gender: "male",
        }
        //第一种方法渲染数据
        // var dataTag = '<ul><li>用户名' + dataInfo.name + '</li><li>年龄' + dataInfo.age + '</li><li>性别' + dataInfo.gender + '</li></ul>'

        var dataTag = `
     <ul>
     <li>${dataInfo.name}</li>
     <li>${dataInfo.age}</li>
     <li>${dataInfo.gender}</li>
     </ul>
    `
        var div = document.getElementById("#box")
        div.innerHTML = dataTag 
    </script>
</body>

</html>